package vip.xiaonuo.modular.business.adapter.IndexDataAnalysis;

import liquibase.pro.packaged.B;
import org.springframework.stereotype.Component;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.pop.GenderDistribution;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.pop.PopData;
import vip.xiaonuo.modular.business.entity.BiIndexData.AnalysisData.pop.PopNumSort;
import vip.xiaonuo.modular.business.entity.BiIndexData.IndexDataVo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description 人口指标附加数据统计
 * @Author cy
 * @Date 2022/8/5 13:34
 * @Version 1.0
 */
@Component
public class PopAdapter implements AbstractAdapter{

    @Override
    public List<Object> additionData() {
        List<Object> result = new ArrayList<>();
        GenderDistribution gd = new GenderDistribution();
        gd.setSex("男");
        gd.setRatio(new BigDecimal(50));
        GenderDistribution gd1 = new GenderDistribution();
        gd1.setSex("女");
        gd1.setRatio(new BigDecimal(50));
        List<GenderDistribution> gdList = new ArrayList<>();
        gdList.add(gd);
        gdList.add(gd1);
        PopNumSort ps = new PopNumSort();
        ps.setAgeGroup("0-20");
        ps.setNum(4000);
        PopNumSort ps1 = new PopNumSort();
        ps1.setAgeGroup("20-40");
        ps1.setNum(5435);
        PopNumSort ps2 = new PopNumSort();
        ps2.setAgeGroup("40-60");
        ps2.setNum(6543);
        List<PopNumSort> pslist = new ArrayList<>();
        pslist.add(ps);
        pslist.add(ps1);
        pslist.add(ps2);

        PopData popData = new PopData();
        popData.setName("男女比例");
        popData.setObj(gdList);
        PopData popData1 = new PopData();
        popData1.setName("人口数量排行");
        popData1.setObj(pslist);
        result.add(popData);
        result.add(popData1);
        return result;
    }
}
